{extend name='extra@admin/content'}

{block name="button"}

{/block}

{block name="content"}

<!-- 表单搜索 开始 -->

<!-- 表单搜索 结束 -->

<form onsubmit="return false;" data-auto="true" method="post">
    {if empty($list)}
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    {else}
    <input type="hidden" value="resort" name="action"/>
    <table class="layui-table" lay-skin="line" lay-size="sm">
        <thead>
            <tr>
                <th class='list-table-check-td'>
                    <input data-none-auto="" data-check-target='.list-check-box' type='checkbox'/>
                </th>
                <th class='text-left nowrap'>商品名称</th>
                <th class='text-left nowrap'>商品图片</th>
                <th class='text-left nowrap'>商品属性</th>
                <th class='text-left nowrap'>商品成本</th>
                <th class='text-left nowrap'>商品成本价</th>
                <th class='text-left nowrap'>操作</th>
            </tr>
        </thead>
        <tbody>
            {foreach $list as $key=>$vo}
            <tr>
                <td class='list-table-check-td'>
                    <input class="list-check-box" value='{$vo.id}' type='checkbox'/>
                </td>
                <td class='text-left nowrap'>
                    {$vo.name}
                </td>
                <td class='text-left nowrap'>
                    {if condition="!empty($vo.logo)"}
                        <img src="{$vo.logo}" whdth="40px;" height="40px;" >
                    {else /}
                    <img src="/public/common/public_images/no_pic.png" whdth="40px;" height="40px;" >
                    {/if}
                </td>
                <td class='text-left nowrap'>
                    {if condition="empty($vo.title)"}
                        无属性
                    {else /}
                        {$vo.title}
                    {/if}
                </td>
                <td class='text-left nowrap'>
                    {foreach name="chengben" item="v" key="k"}
                        {if condition="$k eq $vo.id"}
                                {$v.chengben}
                                 {/if}
                    {/foreach}
                </td>
                <td class='text-left nowrap'>
                    {foreach name="chengben" item="v" key="k"}
                        {if condition="$k eq $vo.id"}
                                {$v.chengben_price}
                                 {/if}
                    {/foreach}
                </td>
                <td class='text-left nowrap'>
                    {if auth("mall/peifang/fenpei")}
                        <span class="text-explode">|</span>
                        <a data-open='{:url("mall/peifang/fenpei")}?id={$vo.id}' href="javascript:void(0)">编辑配方</a>
                    {else /}
                        无权限
                    {/if}
                    <!--{if auth("mall/peifang/detail")}-->
                        <!--<span class="text-explode">|</span>-->
                        <!--<a data-open='{:url("mall/peifang/detail")}?id={$vo.id}' href="javascript:void(0)">配方详情</a>-->
                    <!--{else /}-->
                        <!--无权限-->
                    <!--{/if}-->
                </td>
            </tr>
            {/foreach}
        </tbody>
    </table>
    {if isset($page)}<p>{$page}</p>{/if}
    {/if}
    <script>
        window.laydate.render({range: true, elem: '#range-date', format: 'yyyy/MM/dd'});
    </script>
</form>
{/block}